************************************************
** Master Replication File **
** Title: "Macro Outsourcing: Evaluating Government Reliance on the Private Sector"
** Author: Rachel Augustine Potter
** Journal: The Journal of Politics
** Analysis Data File name: "macrooutsourcing.csv"
** Date: January 2021
** **********************************************


/*
** **********************************************
Note: for complete descriptions of the variables, see the manuscript and the Supporting Information

Variable definitions:
year 					Year
period 					Time period
state 					State name
icpsr	 				State icpsr code
region 					State's region
outsourcing 			Macro outsourcing measure
gopgov 					State has a GOP governor
govcfscore 				Governor's CF score (Bonica 2013)
gopsen 					State senate is controlled by GOP
gopseatsen 				Proportion of seats held by Republicans in state senate
sen_chamber 			Ideology of median legislator in state senate (Shor and McCarty 2011)
gophouse 				State house is controlled by GOP
gopseathouse 			Proportion of seats held by Republicans in state house
hou_chamber				Ideology of median legislator in state house (Shor and McCarty 2011)
divided 				State has a divided government
unifiedr 				State has a unified Republican government
unifiedd 				State has a unified Democratic government
masseconlib_est 		State's economic policy liberalism among the mass public (Caughey and Warshaw 2018)
bias2_2 				Business bias in a state's campaign finance system (Witko 2017)
budget_surplus 			State's budget surplus
debtgsp 				State debt as a percentage of Gross State Product 
incomepcap 				State income per capita
unemployment_rate 		State unemployment rate 
arcpercent 				Fraction of ARC paid (Center for Retirement Research at Boston College)
lnexpenditure92 		Total spending in the state (ln)
covpublic 				Union coverage (Hirsch and MacPherson 2013)
mempublic 				Union density (Hirsch and MacPherson 2013)
union_spend 			Labor spending (National Institute on Money in State Politics)
rtw 					State Right-to-Work law in place
nocollbargaining		State has no collective bargaining law
nebraska_study 			Estimated state outsourcing levels in Nebraska study
dem_voteshare			Democratic presidential vote share

** **********************************************
*/

/*ssc install reghdfe
ssc install ftools
ssc install xtabond2 // for GMM estimation
*/


import delimited "macro.outsourcing.csv"

set scheme s2mono 

xtset icpsr year

gen l1outsourcing = l.outsourcing
gen l2outsourcing = l2.outsourcing
gen lgopsen = l.gopsen
gen lgophouse = l.gophouse
gen lgopgov = l.gopgov
gen ldebtgsp = l.debtgsp
gen lbudget_surplus = l.budget_surplus


*************************************************
*****Analyses in Primary Manuscript
*************************************************
 
 
**************FIGURE 2: Outsourcing by Democratic Presidential Vote
scatter dem_voteshare outsourcing if year ==1992, graphregion(color(white)) ytitle("") xtitle("") ylab(,nogrid) title("1992") name(e1992, replace) ylab(,angle(0)) msize(small)
scatter dem_voteshare outsourcing if year ==1996, graphregion(color(white)) ytitle("") xtitle("") ylab(,nogrid) title("1996") name(e1996, replace) ylab(none)  msize(small)
scatter dem_voteshare outsourcing if year ==2000, graphregion(color(white)) ytitle("") xtitle("") ylab(,nogrid) title("2000") name(e2000, replace) ylab(,angle(0)) msize(small)
scatter dem_voteshare outsourcing if year ==2004, graphregion(color(white)) ytitle("") xtitle("") ylab(,nogrid) title("2004") name(e2004, replace) ylab(none) msize(small)
scatter dem_voteshare outsourcing if year ==2008, graphregion(color(white)) ytitle("") xtitle("") ylab(,nogrid) title("2008") name(e2008, replace) ylab(,angle(0)) msize(small)
scatter dem_voteshare outsourcing if year ==2012, graphregion(color(white)) ytitle("") xtitle("") ylab(,nogrid) title("2012") name(e2012, replace) ylab(none) msize(small)
graph combine e1992 e1996 e2000 e2004 e2008 e2012, row(3) col(2) graphregion(color(white)) ycommon l1(Democratic Vote Share) b1("Macro Outsourcing")


**************TABLE 1: Political Influences on State Macro Outsourcing 
reghdfe outsourcing l.gopgov  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using table1.tex, replace dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo m1a

reghdfe outsourcing l.gophouse l.gopsen l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using table1.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo m1b 

reghdfe outsourcing l.debtgsp l.budget_surplus  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using table1.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo m1c 

reghdfe outsourcing l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using table1.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo m1d

reghdfe outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic, a(icpsr year) cluster(icpsr)
outreg2 using table1.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo m1e

reghdfe outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using table1.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo m1f

reghdfe outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr) cluster(icpsr)
outreg2 using table1.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo m1g

reghdfe outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using table1.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo m1h

esttab m1a m1b m1c m1d m1e m1f m1g m1h , b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE 2: Alternate Operationalizations of Key Independent Variables
/*Note: Table 2 summarizes results from the following tables in Suppporting Information:

Ideology: see Table C-1
Party Control of Government: Table C-2
Fiscal Pressure: Table C-3
Union Strength: Table C-4

See analyses below for individual results. */



*************************************************
*****Analyses in Suppporting Information
*************************************************
 
**************FIGURE A-1: Relationship between Macro Outsourcing Measure and Nebraska Study
lowess  nebraska_study outsourcing, mlabel(stateabbr) ms(none) graphregion(color(white)) ylab(,nogrid) xtitle("Macro Outsourcing: this study") ytitle("State Outsourcing: Nebraska study") mcolor(black) title("") note("") text(.841 .21 "r = .47") name(Nebraskastudy, replace) text(.84  36 "r = .47", )


**************FIGURE A-2: Macro Outsourcing by State, 1992–2015
twoway lowess  outsourcing year ,  by(state, graphregion(color(white)) note("")) xtitle("") ytitle("Macro Outsourcing")   ylab(,nogrid)  name(outbystates, replace) 


**************FIGURE A-3: Macro Outsourcing by Region
twoway (lowess outsourcing year if region == "South") (lowess outsourcing year if region == "Midwest") (lowess outsourcing year if region == "Northeast")  (lowess outsourcing year if region == "West"), graphregion(color(white)) ytitle("Macro Outsourcing") ylab(,nogrid) legend(lab(1 "South") lab(2 "Midwest") lab(3 "Northeast") lab(4 "West")) xtitle("") xscale(range(1992 2017)) xlab(1992 (4) 2017)


**************FIGURE B-1: Evaluating the Parallel Trends Assumption with Lags and Leads
reghdfe outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus l3.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
eststo l3

reghdfe outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus l2.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
eststo l2

reghdfe outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus l1.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
eststo l1

reghdfe outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
eststo l0

reghdfe outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus f1.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
eststo f1

reghdfe outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus f2.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
eststo f2

reghdfe outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus f3.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
eststo f3

reghdfe outsourcing lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus f4.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
eststo f4

coefplot l3 l2 l1 l0 f1 f2 f3 f4, vertical drop(lgopgov lgophouse lgopsen ldebtgsp lbudget_surplus f3.covpublic l1outsourcing l2outsourcing _cons) yline(0, lcolor(black) lpattern(dot)) xline(3.5, lcolor(black) lpattern(dash)) legend(off) graphregion(color(white)) ylab(,nogrid) xlabel(1 "-3" 2 "-2" 3 "-1" 4 "0" 5 "+1" 6 "+2" 7 "+3" 8 "+4") xtitle("Year") levels(95) mcolor(black) ytitle("Union Coverage Coefficient")ciopts(lcolor(black)) msymbol(T) name(placebo, replace)


**************TABLE C-1: Alternate Measures of Ideology and Macro Outsourcing
reghdfe outsourcing l.govcfscore   l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altideology.tex, replace dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c1a

reghdfe outsourcing l.hou_chamber l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altideology.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c1b

reghdfe outsourcing l.sen_chamber  l1outsourcing l2outsourcing if state != "nebraska", a(icpsr year) cluster(icpsr)
outreg2 using altideology.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c1c

reghdfe outsourcing l.hou_chamber l.sen_chamber  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altideology.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c1d

reghdfe outsourcing  l.masseconlib_est l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altideology.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c1e

reghdfe outsourcing  l.bias2_2 l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altideology.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c1f

reghdfe outsourcing l.govcfscore l.hou_chamber l.sen_chamber l.masseconlib_est l.bias2_2 l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altideology.tex, append dec(3) sortvar(l.govcfscore l.hou_chamber l.sen_chamber l.masseconlib_est l.bias2_2 l1outsourcing l2outsourcing) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c1g

esttab c1a c1b c1c c1d c1e c1f c1g, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE C-2: Measures of Party Control of Government and Macro Outsourcing
reghdfe outsourcing  l.gopseathouse l.gopseatsen   l1outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altparty.tex, replace dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001) sortvar(l.gopseathouse l.gopseatsen l.divided   l.unifiedd l.unifiedr l1outsourcing l2outsourcing)
eststo c2a

reghdfe outsourcing  l.gopseathouse l.gopseatsen   l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altparty.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001) sortvar(l.gopseathouse l.gopseatsen l.divided   l.unifiedd l.unifiedr l1outsourcing l2outsourcing)
eststo c2b

reghdfe outsourcing  l.divided  l1outsourcing , a(icpsr year) cluster(icpsr)
outreg2 using altparty.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001) sortvar(l.gopseathouse l.gopseatsen l.divided   l.unifiedd l.unifiedr l1outsourcing l2outsourcing)
eststo c2c

reghdfe outsourcing  l.divided  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altparty.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001) sortvar(l.gopseathouse l.gopseatsen l.divided   l.unifiedd l.unifiedr l1outsourcing l2outsourcing)
eststo c2d

reghdfe outsourcing l.unifiedd l.unifiedr  l1outsourcing , a(icpsr year) cluster(icpsr)
outreg2 using altparty.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001) sortvar(l.gopseathouse l.gopseatsen l.divided   l.unifiedd l.unifiedr l1outsourcing l2outsourcing)
eststo c2e

reghdfe outsourcing l.unifiedd l.unifiedr  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altparty.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001) sortvar(l.gopseathouse l.gopseatsen l.divided   l.unifiedd l.unifiedr l1outsourcing l2outsourcing)
eststo c2f

esttab c2a c2b c2c c2d c2e c2f, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE C-3: Alternate Measures of Fiscal Pressure and Macro Outsourcing
reghdfe outsourcing l.unemployment_rate  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altfiscal.tex, replace   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c3a

reghdfe outsourcing l.incomepcap l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altfiscal.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c3b

reghdfe outsourcing l.arcpercent  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altfiscal.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c3c

reghdfe outsourcing l.unemployment_rate l.incomepcap l.arcpercent , a(icpsr year) cluster(icpsr)
outreg2 using altfiscal.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c3d

reghdfe outsourcing l.unemployment_rate l.incomepcap l.arcpercent  l1outsourcing , a(icpsr year) cluster(icpsr)
outreg2 using altfiscal.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c3e

reghdfe outsourcing l.unemployment_rate l.incomepcap l.arcpercent  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altfiscal.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c3f

esttab c3a c3b c3c c3d c3e c3f, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE C-4: Alternate Measures of Union Strength and Macro Outsourcing
reghdfe outsourcing l.mempublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altunion.tex, replace   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c4a

reghdfe outsourcing union_spend l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altunion.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c4b

reghdfe outsourcing l.mempublic union_spend , a(icpsr year) cluster(icpsr)
outreg2 using altunion.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c4c

reghdfe outsourcing l.mempublic union_spend l1outsourcing , a(icpsr year) cluster(icpsr)
outreg2 using altunion.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c4d

reghdfe outsourcing l.mempublic union_spend l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using altunion.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c4e

esttab c4a c4b c4c c4d c4e, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE C-5: "Ideological Decay" and Macro Outsourcing
reghdfe outsourcing i.b1.l.gopgov#i.period b1.l.gophouse b1.l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using decay.tex, replace   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c5a

reghdfe outsourcing b1.l.gopgov i.b1.l.gophouse#i.period b1.l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using decay.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c5b

reghdfe outsourcing b1.l.gopgov b1.l.gophouse i.b1.l.gopsen#i.period l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using decay.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c5c

reghdfe outsourcing i.b1.l.gopgov#i.period i.b1.l.gophouse#i.period i.b1.l.gopsen#i.period l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using decay.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c5d

esttab c5a c5b c5c c5d, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE C-6: Conditional Effects of Ideology and Macro Outsourcing
reghdfe outsourcing  i.l.gopgov##c.l.debtgsp i.l.gopgov##c.l.budget_surplus l.gophouse l.gopsen  l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using interaction.tex, replace   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c6a

reghdfe outsourcing  i.l.gophouse##c.l.debtgsp i.l.gophouse##c.l.budget_surplus l.gopgov l.gopsen l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using interaction.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c6b

reghdfe outsourcing  i.l.gopsen##c.l.debtgsp i.l.gopsen##c.l.budget_surplus l.gopgov l.gophouse l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using interaction.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c6c

reghdfe outsourcing  i.l.gopgov##c.l.debtgsp i.l.gopgov##c.l.budget_surplus  i.l.gophouse##c.l.debtgsp i.l.gophouse##c.l.budget_surplus  i.l.gopsen##c.l.debtgsp i.l.gopsen##c.l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using interaction.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c6d

esttab c6a c6b c6c c6d, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE C-7: Alternate Lag Structures and Macro Outsourcing
reghdfe outsourcing gopgov gophouse gopsen l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using lags.tex, replace dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c7a

reghdfe outsourcing l2.gopgov l2.gophouse l2.gopsen l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using lags.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c7b

reghdfe outsourcing debtgsp budget_surplus  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using lags.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c7c

reghdfe outsourcing l2.debtgsp l2.budget_surplus  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using lags.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c7d

reghdfe outsourcing covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using lags.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c7e

reghdfe outsourcing l2.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using lags.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c7f

reghdfe outsourcing gopgov gophouse gopsen debtgsp budget_surplus covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using lags.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c7g

reghdfe outsourcing l2.gopgov l2.gophouse l2.gopsen l2.debtgsp l2.budget_surplus l2.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using lags.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c7h

esttab c7a c7b c7c c7d c7e c7f c7g c7h, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE C-8: Political Influences on Differences (∆) in State Macro Outsourcing
reghdfe d.outsourcing l.gopgov  , a(icpsr year) cluster(icpsr)
outreg2 using diff.tex, replace dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c8a

reghdfe d.outsourcing l.gophouse l.gopsen , a(icpsr year) cluster(icpsr)
outreg2 using diff.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c8b 

reghdfe d.outsourcing l.debtgsp l.budget_surplus , a(icpsr year) cluster(icpsr)
outreg2 using diff.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c8c 

reghdfe d.outsourcing l.covpublic , a(icpsr year) cluster(icpsr)
outreg2 using diff.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c8d

reghdfe d.outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic, a(icpsr year) cluster(icpsr)
outreg2 using diff.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c8e

reghdfe d.outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using diff.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c8f

reghdfe d.outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr) cluster(icpsr)
outreg2 using diff.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c8g

reghdfe d.outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using diff.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001) sortvar(l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing)
eststo c8h

esttab c8a c8b c8c c8d c8e c8f c8g c8h, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE C-9: Accounting for Total Spending
gen lnoutsourcing = ln(outsourcing)

reghdfe outsourcing l.covpublic lnexpenditure92 l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using totalspend.tex, replace   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c9a

reghdfe outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus  l.covpublic lnexpenditure92, a(icpsr year) cluster(icpsr)
outreg2 using totalspend.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c9b

reghdfe outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic lnexpenditure92 l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using totalspend.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c9c

reghdfe lnoutsourcing l.covpublic lnexpenditure92 l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using totalspend.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c9d

reghdfe lnoutsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus  l.covpublic lnexpenditure92, a(icpsr year) cluster(icpsr)
outreg2 using totalspend.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c9e

reghdfe lnoutsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic lnexpenditure92 l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using totalspend.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo c9f

esttab c9a c9b c9c c9d c9e c9f, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE C-10: Alternate Modeling Strategies
*Arellano-Bond estimators
tab year, gen(y)

xtabond2 outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing y1-y24  i.icpsr, ///
	gmm(outsourcing, lag(1 3) eq(both))  ///
	iv(l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic y1-y24  i.icpsr, eq(both)) robust
outreg2 using other.tex, replace dec(3) nocons  addtext(State \& Year FE, YES)   label alpha(0.05, 0.01, 0.001) 
eststo c10a

xtabond2 outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing y1-y24  i.icpsr, ///
	gmm(outsourcing, lag(3 5) eq(both)) ///
	iv(l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic y1-y24  i.icpsr, eq(both)) robust
outreg2 using other.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  label alpha(0.05, 0.01, 0.001)  sortvar(gopgov gophouse gopsen debtgsp budget_surplus covpublic)
eststo c10b

*State specific linear time trends
tab icpsr, gen(tstate)
by icpsr: gen trend = _n
forvalues i = 1/50 {
replace tstate`i' = tstate`i'  * trend
}

forvalues k = 1/50 {
gen t2state`k' =. 
replace t2state`k' = tstate`k'  * tstate`k'
}

reghdfe outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic  tstate1- tstate50, a(icpsr year) cluster(icpsr)
outreg2 using other.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  label alpha(0.05, 0.01, 0.001)  sortvar(gopgov gophouse gopsen debtgsp budget_surplus covpublic)
eststo c10c 

reghdfe outsourcing l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic  tstate1- tstate50 t2state1- t2state50, a(icpsr year) cluster(icpsr)
outreg2 using other.tex, append dec(3) nocons  addtext(State \& Year FE, YES)  label alpha(0.05, 0.01, 0.001)  sortvar(gopgov gophouse gopsen debtgsp budget_surplus covpublic  l1outsourcing l2outsourcing) drop(tstate* t2state* year* icpsr*)
eststo c10d

esttab c10a c10b c10c c10d, b se star(* 0.05 ** 0.01 *** 0.001)


**************TABLE D-1: Macro Outsourcing and State Right-To-Work Laws
reghdfe outsourcing l.rtw  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using rtw.tex, replace   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo d1a

reghdfe outsourcing l.rtw l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus  l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using rtw.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo d1b

reghdfe outsourcing l.rtw l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l1outsourcing l2outsourcing, a(icpsr) cluster(icpsr)
outreg2 using rtw.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo d1c

reghdfe outsourcing l.rtw l.gopgov l.gophouse l.gopsen l.debtgsp l.budget_surplus l.covpublic l1outsourcing l2outsourcing, a(icpsr year) cluster(icpsr)
outreg2 using rtw.tex, append   dec(3) nocons  addtext(State \& Year FE, YES)  addstat(States, e(N_clust)) label alpha(0.05, 0.01, 0.001)
eststo d1d

esttab d1a d1b d1c d1d, b se star(* 0.05 ** 0.01 *** 0.001)
